package com.orange.score.model.match;

public class ScoreUpdate
{
  public static final int FLAG_AWAY = 2;
  public static final int FLAG_BOTH = 0;
  public static final int FLAG_HOME = 1;
  public static final int UPDATE_TYPE_RED_CARD = 1;
  public static final int UPDATE_TYPE_SCORE = 0;
  public static final int UPDATE_TYPE_YELLOW_CARD = 2;
  public String awayTeamName;
  public String awayTeamRed;
  public String awayTeamScore;
  public String awayTeamYellow;
  public String date;
  public int homeAwayFlag;
  public String homeTeamName;
  public String homeTeamRed;
  public String homeTeamScore;
  public String homeTeamYellow;
  public int leagueColor;
  public String leagueName;
  public String minutes;
  public String redCardScore;
  public String score;
  public String[] scoreUpdateData;
  public int updateType;
  public String yellowCardScore;

  public static ScoreUpdate createScoreUpdateObject(Match paramMatch, String[] paramArrayOfString)
  {
    Object localObject;
    if ((paramMatch == null) || (paramArrayOfString == null) || (paramArrayOfString.length == 0))
      localObject = null;
    while (true)
    {
      return localObject;
      ScoreUpdate localScoreUpdate = new ScoreUpdate();
      int i = 0;
      int j = 0;
      int k = 0;
      int l = 0;
      int i1 = 0;
      int i2 = 0;
      if (isDataChange(paramArrayOfString[4], paramMatch.homeTeamScore))
        i = 1;
      if (isDataChange(paramArrayOfString[5], paramMatch.awayTeamScore))
        l = 1;
      if (isDataChange(paramArrayOfString[8], paramMatch.homeTeamRed))
        j = 1;
      if (isDataChange(paramArrayOfString[9], paramMatch.awayTeamRed))
        i1 = 1;
      if (isDataChange(paramArrayOfString[10], paramMatch.homeTeamYellow))
        k = 1;
      if (isDataChange(paramArrayOfString[11], paramMatch.awayTeamYellow))
        i2 = 1;
      if ((i != 0) || (l != 0))
      {
        localScoreUpdate.updateType = 0;
        if ((i != 0) && (l != 0))
          localScoreUpdate.homeAwayFlag = 0;
      }
      while (true)
      {
        do
          while (true)
          {
            while (true)
            {
              while (true)
              {
                do
                  while (true)
                  {
                    while (true)
                    {
                      while (true)
                      {
                        do
                          while (true)
                          {
                            while (true)
                            {
                              localScoreUpdate.score = paramArrayOfString[4].concat(":").concat(paramArrayOfString[5]);
                              localScoreUpdate.redCardScore = paramArrayOfString[8].concat(":").concat(paramArrayOfString[9]);
                              localScoreUpdate.yellowCardScore = paramArrayOfString[10].concat(":").concat(paramArrayOfString[11]);
                              localScoreUpdate.scoreUpdateData = paramArrayOfString;
                              localScoreUpdate.minutes = paramMatch.matchMinuteString();
                              localScoreUpdate.homeTeamName = paramMatch.homeTeamName;
                              localScoreUpdate.awayTeamName = paramMatch.awayTeamName;
                              localScoreUpdate.date = paramMatch.getDateString();
                              localScoreUpdate.leagueName = paramMatch.getLeagueName();
                              localScoreUpdate.leagueColor = paramMatch.getLeagueColor();
                              localObject = localScoreUpdate;
                            }
                            if (i == 0)
                              break;
                            localScoreUpdate.homeAwayFlag = 1;
                          }
                        while (l == 0);
                        localScoreUpdate.homeAwayFlag = 2;
                      }
                      if ((j == 0) && (i1 == 0))
                        break label374;
                      localScoreUpdate.updateType = 1;
                      if ((j == 0) || (i1 == 0))
                        break;
                      localScoreUpdate.homeAwayFlag = 0;
                    }
                    if (j == 0)
                      break;
                    localScoreUpdate.homeAwayFlag = 1;
                  }
                while (i1 == 0);
                localScoreUpdate.homeAwayFlag = 2;
              }
              label374: if ((k == 0) && (i2 == 0))
                break label433;
              localScoreUpdate.updateType = 2;
              if ((k == 0) || (i2 == 0))
                break;
              localScoreUpdate.homeAwayFlag = 0;
            }
            if (k == 0)
              break;
            localScoreUpdate.homeAwayFlag = 1;
          }
        while (i2 == 0);
        localScoreUpdate.homeAwayFlag = 2;
      }
      label433: localObject = null;
    }
  }

  public static boolean isDataChange(String paramString1, String paramString2)
  {
    int i;
    if ((paramString2 == null) || (paramString1 == null))
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        int j = 0;
        int k = 0;
        if (paramString2.length() > 0)
          j = Integer.parseInt(paramString2);
        if (paramString1.length() > 0)
          k = Integer.parseInt(paramString1);
        if (k <= j)
          break;
        i = 1;
      }
      i = 0;
    }
  }
}